]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
shell-app: Don't transition to STOPPED while still in the STARTING state
authorMario Sanchez Prada <mario@endlessm.com>
Fri, 29 Sep 2017 10:47:31 +0000 (11:47 +0100)
committerMario Sanchez Prada <mario@endlessm.com>
Fri, 29 Sep 2017 17:10:23 +0000 (18:10 +0100)
Similar to what it's done in _shell_app_add_window(), rely on calling
shell_app_sync_running_state() when removing windows too, to avoid
transitioning to STOPPED while it's still in the STARTING state.

This makes the logic compliant with the startup notification spec and
prevents stopping an application too early if it has a splash screen
that has been closed before the application's main window is shown.

https://bugzilla.gnome.org/show_bug.cgi?id=787905

src/shell-app.c

index 335147c19e38ef28c43de8f35c76aff028bfa4ef..dbf537ce9df4aa26b21b98c42c93f015b1f8c0ca 100644 (file)
@@ -1067,16 +1067,10 @@ _shell_app_remove_window (ShellApp   *app,
 
   if (!meta_window_is_skip_taskbar (window))
     app->running_state->interesting_windows--;
+  shell_app_sync_running_state (app);
 
   if (app->running_state->windows == NULL)
-    {
-      g_clear_pointer (&app->running_state, unref_running_state);
-      shell_app_state_transition (app, SHELL_APP_STATE_STOPPED);
-    }
-  else
-    {
-      shell_app_sync_running_state (app);
-    }
+    g_clear_pointer (&app->running_state, unref_running_state);
 
   g_signal_emit (app, shell_app_signals[WINDOWS_CHANGED], 0);
 }